# -*- coding: utf-8 -*-
"""
Created on Sun Apr 14 09:42:01 2019

@author: LENOVO
"""

ln_path = 'E:/C_Or_CPlusPlus/python/last_name.txt'
fn_path = 'E:/C_Or_CPlusPlus/python/first_name.txt'
fn = []
ln1 = [] #单字名
ln2 = [] #双字名
with open(fn_path,'r',encoding='utf-8') as f:
    for line in f.readlines():
        fn.append(line.split('\n')[0])
print(fn)
with open(ln_path,'r',encoding='utf-8') as f:
    for line in f.readlines():
        if len(line.split('\n')[0]) == 1:
            ln1.append(line.split('\n')[0])
        else:
            ln2.append(line.split('\n')[0])
print(ln1)
print('='*70)
print(ln2)

fn = ('李', '王', '张', '刘')
ln1 = ('娉', '览', '莱', '屹')
ln2 = ('治明', '正顺', '书绎')

import random
class FakeUser:
    def fake_name(self,one_word = False, two_words = False):
        if one_word:
            full_name = random.choice(fn) + random.choice(ln1)
        elif two_words:
            full_name = random.choice(fn) + random.choice(ln2)
        else:
            full_name = random.choice(fn) + random.choice(ln1 + ln2)
        print(full_name)
    def fake_gender(self):
        gender = random.choice(['男','女','未知'])
        print(gender)
        
class SnsUser(FakeUser):
    def get_followers(self,few = True, a_lot = False):
        if few:
            followers = random.randrange(1,50)
        elif a_lot:
            followers = random.randrange(200,10000)
        print(followers)

user_a = FakeUser()
user_b = SnsUser()
user_a.fake_name()
user_b.get_followers(few = True)
